package com.ruoyi.amuse.sensitiveWords.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.amuse.sensitiveWords.domain.SensitiveWords;
import com.ruoyi.amuse.sensitiveWords.mapper.SensitiveWordsMapper;
import com.ruoyi.amuse.sensitiveWords.service.ISensitiveWordsService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

/**
 * @author Season
 * @date 2024-07-09 14:04
 * @description
 */
@Service
@RequiredArgsConstructor
public class SensitiveWordsServiceImpl extends ServiceImpl<SensitiveWordsMapper, SensitiveWords> implements ISensitiveWordsService {

    @Autowired
    protected SensitiveWordsMapper sensitiveWordsMapper;
    @Override
    public Set<String> getAllData() {
        List<SensitiveWords> allData = sensitiveWordsMapper.getAllData();
        Set<String> collect = allData.stream().map(SensitiveWords::getContent).collect(Collectors.toSet());
        return collect;

    }
}
